﻿@page "/sdk/objects/page/m/{RecordId}/manage-custom"

@model WebVella.Erp.Plugins.SDK.Pages.Page.ManageCustomModel
@using WebVella.Erp.Web.Utils;
@{
	Layout = "~/Pages/_AppMaster.cshtml";
	ViewData["Title"] = "Manage Page";
	var pageIconClass = "fa fa-file";
	if (!String.IsNullOrWhiteSpace(Model.ErpPage.IconClass)){
		pageIconClass = Model.ErpPage.IconClass;
	}

}
<wv-page-header color="#dc3545" area-label="Pages" title="@Model.ErpPage.Label" subtitle="Manage Custom body"
				icon-class="@pageIconClass" return-url="@Model.ReturnUrl">
	<wv-page-header-actions>
		<wv-button type='Submit' form="ManageRecord" class='btn btn-blue btn-sm'><span class='fa fa-save go-white'></span> Save Custom Body</wv-button>
		<a href='@Html.Raw(Model.ReturnUrl)' class='btn btn-white btn-sm'>Cancel</a>
	</wv-page-header-actions>

	<wv-page-header-toolbar>
		@foreach (var action in Model.HeaderToolbar)
		{
			@Html.Raw(action)
		}
	</wv-page-header-toolbar>
</wv-page-header>

<wv-validation errors="@Model.Validation.ToErrorList()" message="@Model.Validation.Message"></wv-validation>

<wv-form id="ManageRecord" name="ManageRecord" validation-errors="Model.Validation.ToErrorList()" label-mode="Stacked" mode="Form">
	<wv-section class="mt-4">
		<wv-row>
			<wv-column span="12">
				<wv-field-checkbox label-text="Custom Body" value="@Model.IsRazorBody" name="IsRazorBody"
								   text-true="custom body  enabled" text-false="custom body disabled"></wv-field-checkbox>
			</wv-column>
		</wv-row>
		<div><strong>Templates</strong></div>
		<div>Replace Razor body with template: <button type="button" class="btn btn-link btn-sm">Record List</button></div>
		<wv-row>
			<wv-column span="12">
				<wv-field-code label-text="RazorBody" value="@Model.RazorBody" name="RazorBody" height="600px"></wv-field-code>
			</wv-column>
		</wv-row>
	</wv-section>

</wv-form>